Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1756 - in development/laboratory/planet/components/space: . api api/src/main/org/jpos/space/api interceptor jdbm jdbm/src/main/org/jpos/space persistent proxy tiny transient tspace tspace/src tspace/src/main tspace/src/main/org tspace/src/main/org/jpos tspace/src/main/org/jpos/space tspace/src/main/org/jpos/space/tspace util util/src/main/org/jpos/space/util

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1756 - in development/laboratory/planet/components/space: . api api/src/main/org/jpos/space/api interceptor jdbm jdbm/src/main/org/jpos/space persistent proxy tiny transient tspace tspace/src tspace/src/main tspace/src/main/org tspace/src/main/org/jpos tspace/src/main/org/jpos/space tspace/src/main/org/jpos/space/tspace util util/src/main/org/jpos/space/util
  • Date: Tue, 08 Feb 2005 12:17:29 +0100

Author: niclas
Date: Tue Feb 8 12:17:27 2005
New Revision: 1756

Added:
development/laboratory/planet/components/space/tspace/
development/laboratory/planet/components/space/tspace/build.xml
(contents, props changed)
development/laboratory/planet/components/space/tspace/src/
development/laboratory/planet/components/space/tspace/src/main/
development/laboratory/planet/components/space/tspace/src/main/org/
development/laboratory/planet/components/space/tspace/src/main/org/jpos/

development/laboratory/planet/components/space/tspace/src/main/org/jpos/space/

development/laboratory/planet/components/space/tspace/src/main/org/jpos/space/tspace/

development/laboratory/planet/components/space/tspace/src/main/org/jpos/space/tspace/Expirable.java
(contents, props changed)

development/laboratory/planet/components/space/tspace/src/main/org/jpos/space/tspace/TSpace.java
(contents, props changed)

development/laboratory/planet/components/space/util/src/main/org/jpos/space/util/DefaultTimer.java
(contents, props changed)

development/laboratory/planet/components/space/util/src/main/org/jpos/space/util/ObjectTemplate.java
(contents, props changed)
Modified:
development/laboratory/planet/components/space/api/build.xml

development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/LeasedReference.java

development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/LocalSpace.java

development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/RemoteSpace.java

development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/Space.java

development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/SpaceException.java

development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/SpaceListener.java

development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/Template.java
development/laboratory/planet/components/space/build.xml
development/laboratory/planet/components/space/index.xml
development/laboratory/planet/components/space/interceptor/build.xml
development/laboratory/planet/components/space/jdbm/build.xml

development/laboratory/planet/components/space/jdbm/src/main/org/jpos/space/MD5Template.java
development/laboratory/planet/components/space/persistent/build.xml
development/laboratory/planet/components/space/proxy/build.xml
development/laboratory/planet/components/space/tiny/build.xml
development/laboratory/planet/components/space/transient/build.xml
development/laboratory/planet/components/space/util/build.xml
Log:
Added another space implementation, and a general clean up of the code, incl
change to the new build.xml format.

Modified: development/laboratory/planet/components/space/api/build.xml
==============================================================================
--- development/laboratory/planet/components/space/api/build.xml
(original)
+++ development/laboratory/planet/components/space/api/build.xml Tue
Feb 8 12:17:27 2005
@@ -1,9 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space-api" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/standard.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0

+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-api" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit"
+>
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
</project>

Modified:
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/LeasedReference.java
==============================================================================
---
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/LeasedReference.java
(original)
+++
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/LeasedReference.java
Tue Feb 8 12:17:27 2005
@@ -15,14 +15,14 @@
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
- * "This product includes software developed by the jPOS project
- * (http://www.jpos.org/)". Alternately, this acknowledgment may
- * appear in the software itself, if and wherever such third-party
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
- * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
- * or promote products derived from this software without prior
- * written permission. For written permission, please contact
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
* license AT jpos.org.
*
* 5. Products derived from this software may not be called "jPOS",
@@ -31,14 +31,14 @@
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
@@ -57,43 +57,45 @@
* @author Alejandro Revilla
* @version $Revision: 1.5 $ $Date: 2003/10/13 10:46:15 $
*/
-public class LeasedReference extends TimerTask
+public class LeasedReference extends TimerTask
{
private Object referent;
private long expiration;

- private static Timer timer = new Timer (true);
+ private static Timer timer = new Timer( true );

- private LeasedReference ()
- {
+ private LeasedReference()
+ {
}

- public LeasedReference (Object referent, long duration)
+ public LeasedReference( Object referent, long duration )
{
super();
this.referent = referent;
this.expiration = System.currentTimeMillis() + duration;
timer.schedule( this, duration );
}
-
- public synchronized Object get()
+
+ public synchronized Object get()
{
if( isValid() )
+ {
return this.referent;
+ }
this.referent = null;
this.expiration = 0;
super.cancel();
return null;
}
-
- public synchronized long getExpiration()
+
+ public synchronized long getExpiration()
{
return expiration;
}
-
- public synchronized boolean discard()
+
+ public synchronized boolean discard()
{
- if( isValid() )
+ if( isValid() )
{
this.referent = null;
this.expiration = 0;
@@ -102,30 +104,34 @@
}
return false;
}
-
- public synchronized long renew( long duration )
+
+ public synchronized long renew( long duration )
{
if( isExpired () )
+ {
return -1;
+ }
expiration = System.currentTimeMillis() + duration;
return( expiration );
}
-
- public synchronized boolean isExpired()
+
+ public synchronized boolean isExpired()
{
return expiration <= System.currentTimeMillis();
}
-
- public synchronized boolean isValid()
+
+ public synchronized boolean isValid()
{
return expiration > System.currentTimeMillis();
}
-
- public void run()
+
+ public void run()
{
long duration = expiration - System.currentTimeMillis();
if( duration < 0 )
+ {
discard();
+ }
}
}


Modified:
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/LocalSpace.java
==============================================================================
---
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/LocalSpace.java
(original)
+++
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/LocalSpace.java
Tue Feb 8 12:17:27 2005
@@ -15,14 +15,14 @@
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
- * "This product includes software developed by the jPOS project
- * (http://www.jpos.org/)". Alternately, this acknowledgment may
- * appear in the software itself, if and wherever such third-party
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
- * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
- * or promote products derived from this software without prior
- * written permission. For written permission, please contact
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
* license AT jpos.org.
*
* 5. Products derived from this software may not be called "jPOS",
@@ -31,14 +31,14 @@
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
@@ -57,29 +57,19 @@
*
* @metro.service type="org.jpos.space.api.LocalSpace" version="1.0"
*/
-public interface LocalSpace extends Space
+public interface LocalSpace extends Space
{
/**
* add a SpaceListener associated with a given key
* @param key Entry's key
* @param listener a SpaceListener
*/
- public void addListener( Object key, SpaceListener listener );
+ void addListener( Object key, SpaceListener listener );

/**
* removes a SpaceListener associated with a given key
* @param key Entry's key
* @param listener the SpaceListener
*/
- public void removeListener( Object key, SpaceListener listener );
-
- /**
- * @return Set containing all keys in Space
- */
- public Set getKeySet();
-
- /**
- * @return number of entries in a given key
- */
- public int size( Object key );
+ void removeListener( Object key, SpaceListener listener );
}

Modified:
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/RemoteSpace.java
==============================================================================
---
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/RemoteSpace.java
(original)
+++
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/RemoteSpace.java
Tue Feb 8 12:17:27 2005
@@ -15,14 +15,14 @@
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
- * "This product includes software developed by the jPOS project
- * (http://www.jpos.org/)". Alternately, this acknowledgment may
- * appear in the software itself, if and wherever such third-party
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
- * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
- * or promote products derived from this software without prior
- * written permission. For written permission, please contact
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
* license AT jpos.org.
*
* 5. Products derived from this software may not be called "jPOS",
@@ -31,14 +31,14 @@
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
@@ -54,7 +54,7 @@
import java.rmi.RemoteException;

/**
- * RMI based Space proxy
+ * RMI based Space interface
*
* @author Alejandro Revilla
* @version $Revision: 1.2 $ $Date: 2002/08/06 14:26:32 $
@@ -64,7 +64,7 @@
* @metro.service type="org.jpos.space.api.RemoteSpace" version="1.0"
*/

-public interface RemoteSpace extends Remote
+public interface RemoteSpace extends Remote
{

/**
@@ -73,7 +73,7 @@
* @param value Object value
* @throws RemoteException
*/
- public void out( Serializable key, Serializable value )
+ public void out( Serializable key, Serializable value )
throws RemoteException;


@@ -131,7 +131,7 @@
throws RemoteException;

/**
- * In probe takes an entry from the space if one exists,
+ * In probe takes an entry from the space if one exists,
* return null otherwise.
* @param key Entry's key
* @return value or null
@@ -141,7 +141,7 @@
throws RemoteException;

/**
- * Read probe reads an entry from the space if one exists,
+ * Read probe reads an entry from the space if one exists,
* return null otherwise.
* @param key Entry's key
* @return value or null

Modified:
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/Space.java
==============================================================================
---
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/Space.java
(original)
+++
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/Space.java
Tue Feb 8 12:17:27 2005
@@ -15,14 +15,14 @@
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
- * "This product includes software developed by the jPOS project
- * (http://www.jpos.org/)". Alternately, this acknowledgment may
- * appear in the software itself, if and wherever such third-party
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
- * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
- * or promote products derived from this software without prior
- * written permission. For written permission, please contact
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
* license AT jpos.org.
*
* 5. Products derived from this software may not be called "jPOS",
@@ -31,14 +31,14 @@
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
@@ -50,13 +50,13 @@
package org.jpos.space.api;


-/**
- * <p><b>Space</b> uses concepts described in the Linda Coordination
Language
- * that eases the implementation of other jPOS components (such as
+/** The Space API.
+ * <p><b>Space</b> uses concepts described in the Linda Coordination Language
+ * that eases the implementation of other jPOS components (such as
* Channels, Muxes, etc.), but it is not by any means an attempt to provide
* a full implementation.</p>
*
- * <p>jPOS's Space is basically a Map where each entry is a LinkedList
+ * <p>jPOS's Space is basically a Map where each entry is a LinkedList
* of values that can be used as a BlockingQueue</p>
*
* <p>One can place entries on a queue by calling Space.out, take them
@@ -73,14 +73,14 @@
* @metro.service type="org.jpos.space.api.Space" version="1.0"
*/

-public interface Space
+public interface Space
{
/**
* Write a new entry into the Space
* @param key Entry's key
* @param value Object value
*/
- void out( Object key, Object value);
+ void out( Object key, Object value );

/**
* Write a new entry into the Space, with an timeout value
@@ -88,21 +88,21 @@
* @param value Object value
* @param timeout timeout value
*/
- void out( Object key, Object value, long timeout);
+ void out( Object key, Object value, long timeout );

/**
* Take an entry from the space, waiting forever until one exists.
* @param key Entry's key
* @return value
*/
- Object in( Object key);
+ Object in( Object key );

/**
* Read an entry from the space, waiting forever until one exists.
* @param key Entry's key
* @return value
*/
- Object rd( Object key);
+ Object rd( Object key );

/**
* Take an entry from the space, waiting a limited amount of time
@@ -111,7 +111,7 @@
* @param timeout millis to wait
* @return value or null
*/
- Object in( Object key, long timeout);
+ Object in( Object key, long timeout );


/**
@@ -121,24 +121,24 @@
* @param timeout millis to wait
* @return value or null
*/
- Object rd( Object key, long timeout);
+ Object rd( Object key, long timeout );


/**
- * In probe takes an entry from the space if one exists,
+ * In probe takes an entry from the space if one exists,
* return null otherwise.
* @param key Entry's key
* @return value or null
*/
- Object inp( Object key);
+ Object inp( Object key );


/**
- * Read probe reads an entry from the space if one exists,
+ * Read probe reads an entry from the space if one exists,
* return null otherwise.
* @param key Entry's key
* @return value or null
*/
- Object rdp( Object key);
+ Object rdp( Object key );
}


Modified:
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/SpaceException.java
==============================================================================
---
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/SpaceException.java
(original)
+++
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/SpaceException.java
Tue Feb 8 12:17:27 2005
@@ -15,14 +15,14 @@
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
- * "This product includes software developed by the jPOS project
- * (http://www.jpos.org/)". Alternately, this acknowledgment may
- * appear in the software itself, if and wherever such third-party
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
- * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
- * or promote products derived from this software without prior
- * written permission. For written permission, please contact
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
* license AT jpos.org.
*
* 5. Products derived from this software may not be called "jPOS",
@@ -31,14 +31,14 @@
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
@@ -50,8 +50,8 @@

/**
* org.jpos.space.Space operations do not declare any checked exceptions.
- *
- * Persistent space implementations can raise some exceptions that
+ *
+ * Persistent space implementations can raise some exceptions that
* are wrapped around this unchecked SpaceException that we recommend to
* catch.
*
@@ -59,25 +59,25 @@
* @version $Revision: 1.3 $ $Date: 2003/10/13 10:46:16 $
* @since 1.4.7
*/
-public class SpaceException extends RuntimeException
+public class SpaceException extends RuntimeException
{
- public SpaceException()
+ public SpaceException()
{
super();
}
-
- public SpaceException(String message)
+
+ public SpaceException( String message )
{
- super(message);
+ super( message );
}
-
- public SpaceException(String message, Throwable cause)
+
+ public SpaceException( String message, Throwable cause )
{
- super(message, cause);
+ super( message, cause );
}
-
- public SpaceException(Throwable cause)
+
+ public SpaceException( Throwable cause )
{
- super(cause);
+ super( cause );
}
}

Modified:
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/SpaceListener.java
==============================================================================
---
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/SpaceListener.java
(original)
+++
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/SpaceListener.java
Tue Feb 8 12:17:27 2005
@@ -15,14 +15,14 @@
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
- * "This product includes software developed by the jPOS project
- * (http://www.jpos.org/)". Alternately, this acknowledgment may
- * appear in the software itself, if and wherever such third-party
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
- * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
- * or promote products derived from this software without prior
- * written permission. For written permission, please contact
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
* license AT jpos.org.
*
* 5. Products derived from this software may not be called "jPOS",
@@ -31,14 +31,14 @@
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
@@ -55,15 +55,15 @@
* @since 2.0
* @see Space
*/
-public interface SpaceListener
+public interface SpaceListener
{
/**
- * <p>Called by Space implementation whenever an object
+ * <p>Called by Space implementation whenever an object
* with the given key is being placed in the Space.</p>
*
* @param key Object's key
* @param value Object's value
*/
- public void notify (Object key, Object value);
+ public void notify( Object key, Object value );
}


Modified:
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/Template.java
==============================================================================
---
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/Template.java
(original)
+++
development/laboratory/planet/components/space/api/src/main/org/jpos/space/api/Template.java
Tue Feb 8 12:17:27 2005
@@ -15,14 +15,14 @@
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
- * "This product includes software developed by the jPOS project
- * (http://www.jpos.org/)". Alternately, this acknowledgment may
- * appear in the software itself, if and wherever such third-party
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
- * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
- * or promote products derived from this software without prior
- * written permission. For written permission, please contact
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
* license AT jpos.org.
*
* 5. Products derived from this software may not be called "jPOS",
@@ -31,14 +31,14 @@
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
@@ -49,10 +49,10 @@

package org.jpos.space.api;

-public interface Template
+public interface Template
{
- public Object getKey ();
-
- public boolean equals (Object obj);
+ Object getKey();
+
+ boolean equals( Object obj );
}


Modified: development/laboratory/planet/components/space/build.xml
==============================================================================
--- development/laboratory/planet/components/space/build.xml (original)
+++ development/laboratory/planet/components/space/build.xml Tue Feb 8
12:17:27 2005
@@ -1,9 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space" default="default" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/reactor.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space" default="default" basedir="."
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="artifact:template:dpml/magic/reactor"/>

</project>

Modified: development/laboratory/planet/components/space/index.xml
==============================================================================
--- development/laboratory/planet/components/space/index.xml (original)
+++ development/laboratory/planet/components/space/index.xml Tue Feb 8
12:17:27 2005
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>

<index>
- <import uri="artifact:module:dpml/metro/tools/dpml-metro-tools#SNAPSHOT" />
- <import uri="artifact:module:dpml/metro/public/dpml-metro-public#SNAPSHOT"
/>
-
+ <import uri="artifact:module:dpml/metro/dpml-metro#SNAPSHOT" />
+
<resource>
<info>
<name>jdbm</name>
@@ -11,7 +10,7 @@
<version>0.20-dev</version>
</info>
</resource>
-
+
<project basedir="api" >
<info>
<name>jpos-space-api</name>
@@ -22,7 +21,7 @@
<include key="dpml-meta-tools" />
</plugins>
</project>
-
+
<project basedir="interceptor" >
<info>
<name>jpos-space-interceptor</name>
@@ -30,13 +29,13 @@
<version>2.0.0</version>
</info>
<dependencies>
- <include key="jpos-space-api" />
+ <include key="jpos-space-api" />
</dependencies>
<plugins>
<include key="dpml-meta-tools" />
</plugins>
</project>
-
+
<project basedir="jdbm" >
<info>
<name>jpos-space-jdbm</name>
@@ -44,15 +43,15 @@
<version>2.0.0</version>
</info>
<dependencies>
- <include key="jpos-space-api" />
- <include key="jdbm" />
- <include key="dpml-parameters-api" />
+ <include key="jpos-space-api" />
+ <include key="jdbm" />
+ <include key="dpml-parameters-api" />
</dependencies>
<plugins>
<include key="dpml-meta-tools" />
</plugins>
</project>
-
+
<project basedir="persistent" >
<info>
<name>jpos-space-persistent</name>
@@ -60,14 +59,14 @@
<version>2.0.0</version>
</info>
<dependencies>
- <include key="jpos-space-api" />
- <include key="dpml-parameters-api" />
+ <include key="jpos-space-api" />
+ <include key="dpml-parameters-api" />
</dependencies>
<plugins>
<include key="dpml-meta-tools" />
</plugins>
</project>
-
+
<project basedir="proxy" >
<info>
<name>jpos-space-proxy</name>
@@ -75,17 +74,17 @@
<version>2.0.0</version>
</info>
<dependencies>
- <include key="dpml-activity-api" />
- <include key="dpml-logging-api" />
- <include key="dpml-parameters-api" />
- <include key="dpml-service-api" />
- <include key="jpos-space-api" />
+ <include key="dpml-activity-api" />
+ <include key="dpml-logging-api" />
+ <include key="dpml-parameters-api" />
+ <include key="dpml-service-api" />
+ <include key="jpos-space-api" />
</dependencies>
<plugins>
<include key="dpml-meta-tools" />
</plugins>
</project>
-
+
<project basedir="tiny" >
<info>
<name>jpos-space-tiny</name>
@@ -93,13 +92,13 @@
<version>2.0.0</version>
</info>
<dependencies>
- <include key="jpos-space-api" />
+ <include key="jpos-space-api" />
</dependencies>
<plugins>
<include key="dpml-meta-tools" />
</plugins>
</project>
-
+
<project basedir="transient" >
<info>
<name>jpos-space-transient</name>
@@ -107,13 +106,28 @@
<version>2.0.0</version>
</info>
<dependencies>
- <include key="jpos-space-api" />
+ <include key="jpos-space-api" />
+ </dependencies>
+ <plugins>
+ <include key="dpml-meta-tools" />
+ </plugins>
+ </project>
+
+ <project basedir="tspace" >
+ <info>
+ <name>jpos-space-tspace</name>
+ <group>jpos/space</group>
+ <version>2.0.0</version>
+ </info>
+ <dependencies>
+ <include key="jpos-space-api" />
+ <include key="jpos-space-util" />
</dependencies>
<plugins>
<include key="dpml-meta-tools" />
</plugins>
</project>
-
+
<project basedir="util" >
<info>
<name>jpos-space-util</name>
@@ -121,12 +135,12 @@
<version>2.0.0</version>
</info>
<dependencies>
- <include key="jpos-space-api" />
- <include key="dpml-parameters-api" />
- <include key="dpml-service-api" />
+ <include key="jpos-space-api" />
+ <include key="dpml-parameters-api" />
+ <include key="dpml-service-api" />
</dependencies>
<plugins>
<include key="dpml-meta-tools" />
</plugins>
</project>
-</index>
+</index>

Modified: development/laboratory/planet/components/space/interceptor/build.xml
==============================================================================
--- development/laboratory/planet/components/space/interceptor/build.xml
(original)
+++ development/laboratory/planet/components/space/interceptor/build.xml
Tue Feb 8 12:17:27 2005
@@ -1,9 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space-interceptor" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/standard.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-interceptor" default="install" basedir="."
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+ xmlns:transit="antlib:net.dpml.transit"
+>
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>

</project>

Modified: development/laboratory/planet/components/space/jdbm/build.xml
==============================================================================
--- development/laboratory/planet/components/space/jdbm/build.xml
(original)
+++ development/laboratory/planet/components/space/jdbm/build.xml Tue
Feb 8 12:17:27 2005
@@ -1,10 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space-jdbm" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/standard.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-jdbm" default="install" basedir="."
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+ xmlns:transit="antlib:net.dpml.transit"
+>
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="jdbm-space">

Modified:
development/laboratory/planet/components/space/jdbm/src/main/org/jpos/space/MD5Template.java
==============================================================================
---
development/laboratory/planet/components/space/jdbm/src/main/org/jpos/space/MD5Template.java
(original)
+++
development/laboratory/planet/components/space/jdbm/src/main/org/jpos/space/MD5Template.java
Tue Feb 8 12:17:27 2005
@@ -15,14 +15,14 @@
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
- * "This product includes software developed by the jPOS project
- * (http://www.jpos.org/)". Alternately, this acknowledgment may
- * appear in the software itself, if and wherever such third-party
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
- * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
- * or promote products derived from this software without prior
- * written permission. For written permission, please contact
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
* license AT jpos.org.
*
* 5. Products derived from this software may not be called "jPOS",
@@ -31,14 +31,14 @@
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
@@ -49,10 +49,13 @@

package org.jpos.space.jdbm;

-import java.util.Arrays;
+import java.io.IOException;
+import java.io.Serializable;
+
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
-import java.io.Serializable;
+
+import java.util.Arrays;

import jdbm.helper.DefaultSerializer;

@@ -60,44 +63,53 @@
import org.jpos.space.api.Template;


-public class MD5Template
- implements Template, Serializable
+public class MD5Template
+ implements Template, Serializable
{
private byte[] digest;
private Object key;

- public MD5Template( Object key, Object value )
+ public MD5Template( Object key, Object value )
{
super();
this.key = key;
this.digest = digest( value );
}
-
- public MD5Template( Object key, byte[] digest )
+
+ public MD5Template( Object key, byte[] digest )
{
super();
this.key = key;
this.digest = digest;
}
-
- public static byte[] digest( Object obj )
+
+ public static byte[] digest( Object obj )
{
- try
+ MessageDigest md = null;
+ try
+ {
+ md = MessageDigest.getInstance( "MD5" );
+ } catch( NoSuchAlgorithmException e )
+ {
+ // Can not happen.
+ }
+ byte[] data;
+ try
{
- MessageDigest md = MessageDigest.getInstance( "MD5" );
- return md.digest( DefaultSerializer.INSTANCE.serialize( obj ) );
- } catch( Exception e )
+ data = DefaultSerializer.INSTANCE.serialize( obj );
+ } catch( IOException e )
{
throw new SpaceException( e );
}
+ return md.digest( data );
}
-
- public boolean equals( Object obj )
+
+ public boolean equals( Object obj )
{
return Arrays.equals( digest( obj ), digest );
}
-
- public Object getKey()
+
+ public Object getKey()
{
return key;
}

Modified: development/laboratory/planet/components/space/persistent/build.xml
==============================================================================
--- development/laboratory/planet/components/space/persistent/build.xml
(original)
+++ development/laboratory/planet/components/space/persistent/build.xml Tue
Feb 8 12:17:27 2005
@@ -1,10 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space-persistent" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/standard.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-persistent" default="install" basedir="."
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build" >
<x:block name="persistent-space" >

Modified: development/laboratory/planet/components/space/proxy/build.xml
==============================================================================
--- development/laboratory/planet/components/space/proxy/build.xml
(original)
+++ development/laboratory/planet/components/space/proxy/build.xml Tue
Feb 8 12:17:27 2005
@@ -1,9 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space-proxy" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/standard.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0

+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-proxy" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
</project>

Modified: development/laboratory/planet/components/space/tiny/build.xml
==============================================================================
--- development/laboratory/planet/components/space/tiny/build.xml
(original)
+++ development/laboratory/planet/components/space/tiny/build.xml Tue
Feb 8 12:17:27 2005
@@ -1,10 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space-tiny" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/standard.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-tiny" default="install" basedir="."
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+ xmlns:transit="antlib:net.dpml.transit"
+>
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="tiny-space">

Modified: development/laboratory/planet/components/space/transient/build.xml
==============================================================================
--- development/laboratory/planet/components/space/transient/build.xml
(original)
+++ development/laboratory/planet/components/space/transient/build.xml Tue
Feb 8 12:17:27 2005
@@ -1,10 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space-transient" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/standard.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-transient" default="install" basedir="."
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+ xmlns:transit="antlib:net.dpml.transit"
+>
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="transient-space">

Added: development/laboratory/planet/components/space/tspace/build.xml
==============================================================================
--- (empty file)
+++ development/laboratory/planet/components/space/tspace/build.xml Tue
Feb 8 12:17:27 2005
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-tspace" default="install" basedir="."
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+ xmlns:transit="antlib:net.dpml.transit"
+>
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="build" depends="standard.build">
+ <x:block name="tiny-space">
+ <x:service type="org.jpos.space.api.LocalSpace" source="space-impl" />
+ <x:component name="space-impl" class="org.jpos.space.tiny.Tinypace" />
+ </x:block>
+ </target>
+
+</project>

Added:
development/laboratory/planet/components/space/tspace/src/main/org/jpos/space/tspace/Expirable.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/space/tspace/src/main/org/jpos/space/tspace/Expirable.java
Tue Feb 8 12:17:27 2005
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2004 jPOS.org
+ *
+ * See terms of license at http://jpos.org/license.html
+ *
+ */
+package org.jpos.space.tspace;
+
+class Expirable implements Comparable
+{
+ Object value;
+ long expires;
+
+ public Expirable( Object value, long expires )
+ {
+ super();
+ this.value = value;
+ this.expires = expires;
+ }
+
+ public boolean isExpired()
+ {
+ return expires < System.currentTimeMillis();
+ }
+
+ public String toString()
+ {
+ return getClass().getName()
+ + "@" + Integer.toHexString( hashCode() )
+ + ", value=" + value.toString()
+ + ", expired=" + isExpired ();
+ }
+
+ public Object getValue()
+ {
+ if( isExpired() )
+ {
+ return null;
+ }
+ return value;
+ }
+
+ public int compareTo( Object obj )
+ {
+ Expirable other = (Expirable) obj;
+ long otherExpires = other.expires;
+ if( otherExpires == expires )
+ {
+ return 0;
+ }
+ else if( expires < otherExpires )
+ {
+ return -1;
+ }
+ else
+ {
+ return 1;
+ }
+ }
+}
+

Added:
development/laboratory/planet/components/space/tspace/src/main/org/jpos/space/tspace/TSpace.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/space/tspace/src/main/org/jpos/space/tspace/TSpace.java
Tue Feb 8 12:17:27 2005
@@ -0,0 +1,382 @@
+/*
+ * Copyright (c) 2004 jPOS.org
+ *
+ * See terms of license at http://jpos.org/license.html
+ *
+ */
+package org.jpos.space.tspace;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.HashMap;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.jpos.space.api.LocalSpace;
+import org.jpos.space.api.SpaceListener;
+import org.jpos.space.api.Template;
+
+import org.jpos.space.util.DefaultTimer;
+import org.jpos.space.util.ObjectTemplate;
+
+/**
+ * TSpace implementation
+ * @author Alejandro Revilla
+ * @version $Rev$
+ * @metro.component name="transient-space" lifestyle="singleton"
+ * @metro.service type="org.jpos.space.api.LocalSpace"
+ * @metro.service type="org.jpos.space.api.Space"
+ */
+public class TSpace extends TimerTask
+ implements LocalSpace
+{
+ public static final long GCDELAY = 60*1000;
+
+ protected Map m_entries;
+ protected TSpace m_spaceListeners; // space listeners
+
+ public TSpace()
+ {
+ super();
+ m_entries = new HashMap();
+ Timer timer = DefaultTimer.getTimer();
+ timer.schedule( this, GCDELAY, GCDELAY );
+ }
+
+ public synchronized void out( Object key, Object value )
+ {
+ List list = getList( key );
+ list.add( value );
+ this.notifyAll();
+ notifyListeners( key, value );
+ }
+
+ public void out( Object key, Object value, long timeout )
+ {
+ if( timeout > 0 )
+ {
+ long expireTime = System.currentTimeMillis() + timeout;
+ value = new Expirable( value, expireTime );
+ }
+ synchronized (this)
+ {
+ List list = getList( key );
+ list.add( value );
+ this.notifyAll();
+ }
+ notifyListeners(key, value);
+ }
+
+ public synchronized Object rdp( Object key )
+ {
+ if( key instanceof Template )
+ {
+ return getObject( (Template) key, false );
+ }
+ return getHead( key, false );
+ }
+
+ public synchronized Object inp( Object key )
+ {
+ if( key instanceof Template )
+ {
+ return getObject( (Template) key, true );
+ }
+ return getHead( key, true );
+ }
+
+ public synchronized Object in( Object key )
+ {
+ Object obj = inp( key );
+ while( obj == null)
+ {
+ try
+ {
+ this.wait();
+ }
+ catch( InterruptedException e )
+ {
+ }
+ obj = inp( key );
+ }
+ return obj;
+ }
+
+ public synchronized Object in( Object key, long timeout )
+ {
+ Object obj = inp( key );
+ long now = System.currentTimeMillis();
+ long end = now + timeout;
+ while( obj == null && now < end )
+ {
+ try
+ {
+ this.wait( end - now );
+ }
+ catch( InterruptedException e )
+ {
+ }
+ obj = inp( key );
+ now = System.currentTimeMillis();
+ }
+ return obj;
+ }
+
+ public synchronized Object rd( Object key )
+ {
+ Object obj = rdp( key );
+ while( obj == null )
+ {
+ try
+ {
+ this.wait ();
+ }
+ catch (InterruptedException e)
+ {
+ }
+ obj = rdp( key );
+ }
+ return obj;
+ }
+
+ public synchronized Object rd( Object key, long timeout )
+ {
+ Object obj = rdp( key );
+ long now = System.currentTimeMillis();
+ long end = now + timeout;
+ while( obj == null && now < end )
+ {
+ try
+ {
+ this.wait( end - now );
+ }
+ catch( InterruptedException e )
+ {
+ }
+ obj = rdp( key );
+ now = System.currentTimeMillis();
+ }
+ return obj;
+ }
+
+ public void run ()
+ {
+ gc();
+ }
+
+ public void gc()
+ {
+ Object[] keys;
+ synchronized( this )
+ {
+ keys = m_entries.keySet().toArray();
+ }
+ for( int i = 0; i < keys.length; i++)
+ {
+ rdp( keys[i] );
+ Thread.yield();
+ }
+ if( m_spaceListeners != null )
+ {
+ m_spaceListeners.gc();
+ synchronized (this)
+ {
+ if( m_spaceListeners != null && m_spaceListeners.isEmpty() )
+ {
+ m_spaceListeners = null;
+ }
+ }
+ }
+ }
+
+ public synchronized int size( Object key )
+ {
+ List list = (List) m_entries.get( key );
+ if( list == null )
+ {
+ return 0;
+ }
+ return list.size();
+ }
+
+ public synchronized void addListener( Object key, SpaceListener listener
)
+ {
+ getSpaceListeners().out( key, listener );
+ }
+
+ public synchronized void addListener( Object key, SpaceListener
listener, long timeout )
+ {
+ getSpaceListeners().out( key, listener, timeout );
+ }
+
+ public synchronized void removeListener( Object key, SpaceListener
listener )
+ {
+ if( m_spaceListeners != null )
+ {
+ ObjectTemplate template = new ObjectTemplate( key, listener );
+ m_spaceListeners.inp( template );
+ }
+ }
+
+ public boolean isEmpty()
+ {
+ return m_entries.isEmpty();
+ }
+
+ public Set getKeySet()
+ {
+ return m_entries.keySet();
+ }
+
+ public String getKeysAsString()
+ {
+ StringBuffer sb = new StringBuffer();
+ Object[] keys;
+ synchronized( this )
+ {
+ keys = m_entries.keySet().toArray();
+ }
+
+ for( int i = 0; i < keys.length; i++ )
+ {
+ if( i > 0 )
+ {
+ sb.append( ' ' );
+ }
+ sb.append( keys[i] );
+ }
+ return sb.toString();
+ }
+
+ public void notifyListeners( Object key, Object value )
+ {
+ Object[] listeners = null;
+ synchronized( this )
+ {
+ if( m_spaceListeners == null )
+ {
+ return;
+ }
+ List l = (List) m_spaceListeners.m_entries.get( key );
+ if( l != null )
+ {
+ listeners = l.toArray();
+ }
+ }
+
+ if( listeners != null )
+ {
+ for( int i = 0; i < listeners.length; i++ )
+ {
+ Object o = listeners[i];
+ if( o instanceof Expirable )
+ {
+ Expirable exp = (Expirable) o;
+ o = exp.getValue();
+ }
+ if( o instanceof SpaceListener )
+ {
+ SpaceListener listener = (SpaceListener) o;
+ listener.notify( key, value );
+ }
+ }
+ }
+ }
+
+ private List getList( Object key )
+ {
+ List list = (List) m_entries.get( key );
+ if( list == null )
+ {
+ list = new LinkedList();
+ m_entries.put( key, list );
+ }
+ return list;
+ }
+
+ private Object getHead( Object key, boolean remove )
+ {
+ Object obj = null;
+ List list = (List) m_entries.get( key );
+ while( obj == null && list != null && list.size() > 0 )
+ {
+ obj = list.get( 0 );
+ if( obj instanceof Expirable )
+ {
+ Expirable exp = (Expirable) obj;
+ obj = exp.getValue();
+ if( obj == null )
+ {
+ list.remove( 0 );
+ if( list.size() == 0 )
+ {
+ m_entries.remove( key );
+ }
+ }
+ }
+ }
+
+ if( obj != null && remove )
+ {
+ list.remove( 0 );
+ if( list.size() == 0)
+ {
+ m_entries.remove( key );
+ }
+ }
+ return obj;
+ }
+
+ private Object getObject( Template tmpl, boolean remove )
+ {
+ Object obj = null;
+ List list = (List) m_entries.get( tmpl.getKey() );
+ if( list == null )
+ {
+ return obj;
+ }
+
+ Iterator iter = list.iterator();
+ while( iter.hasNext() )
+ {
+ obj = iter.next();
+ if( obj instanceof Expirable )
+ {
+ Expirable exp = (Expirable) obj;
+ obj = exp.getValue();
+ if( obj == null )
+ {
+ iter.remove();
+ continue;
+ }
+ }
+ if( tmpl.equals( obj ) )
+ {
+ if( remove )
+ {
+ iter.remove();
+ }
+ break;
+ }
+ else
+ {
+ obj = null;
+ }
+ }
+ return obj;
+ }
+
+ private TSpace getSpaceListeners()
+ {
+ if( m_spaceListeners == null )
+ {
+ m_spaceListeners = new TSpace();
+ }
+ return m_spaceListeners;
+ }
+
+}
+

Modified: development/laboratory/planet/components/space/util/build.xml
==============================================================================
--- development/laboratory/planet/components/space/util/build.xml
(original)
+++ development/laboratory/planet/components/space/util/build.xml Tue
Feb 8 12:17:27 2005
@@ -1,9 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2004 Niclas Hedhman

-<project name="jpos-space-util" default="install" basedir="."
- xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at

- <transit:init/>
- <import file="${dpml.templates}/standard.xml"/>
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project name="jpos-space-util" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit"
+>
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>

</project>

Added:
development/laboratory/planet/components/space/util/src/main/org/jpos/space/util/DefaultTimer.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/space/util/src/main/org/jpos/space/util/DefaultTimer.java
Tue Feb 8 12:17:27 2005
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2000 jPOS.org. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the jPOS project
+ * (http://www.jpos.org/)". Alternately, this acknowledgment may
+ * appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear.
+ *
+ * 4. The names "jPOS" and "jPOS.org" must not be used to endorse
+ * or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * license AT jpos.org.
+ *
+ * 5. Products derived from this software may not be called "jPOS",
+ * nor may "jPOS" appear in their name, without prior written
+ * permission of the jPOS project.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE JPOS PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the jPOS Project. For more
+ * information please see <http://www.jpos.org/>.
+ */
+
+package org.jpos.space.util;
+
+import java.util.Timer;
+
+/**
+ * Timer accesor singleton
+ * @author Alejandro P. Revilla
+ * @version $Id: DefaultTimer.java,v 1.2 2003/05/16 04:11:04 alwyns Exp $
+ */
+
+public class DefaultTimer
+{
+ private static Timer defaultTimer = null;
+
+ private DefaultTimer()
+ {
+ }
+
+ public static Timer getTimer()
+ {
+ synchronized( DefaultTimer.class )
+ {
+ if( defaultTimer == null )
+ {
+ defaultTimer = new Timer();
+ }
+ return defaultTimer;
+ }
+ }
+}

Added:
development/laboratory/planet/components/space/util/src/main/org/jpos/space/util/ObjectTemplate.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/components/space/util/src/main/org/jpos/space/util/ObjectTemplate.java
Tue Feb 8 12:17:27 2005
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2004 jPOS.org
+ *
+ * See terms of license at http://jpos.org/license.html
+ *
+ */
+package org.jpos.space.util;
+
+import java.io.Serializable;
+
+import org.jpos.space.api.Template;
+
+public class ObjectTemplate
+ implements Template
+{
+ Object key;
+ Object value;
+
+ public ObjectTemplate( Object key, Object value )
+ {
+ super ();
+ this.key = key;
+ this.value = value;
+ }
+
+ public boolean equals( Object obj )
+ {
+ return value.equals( obj );
+ }
+
+ public Object getKey()
+ {
+ return key;
+ }
+}
+



  • svn commit: r1756 - in development/laboratory/planet/components/space: . api api/src/main/org/jpos/space/api interceptor jdbm jdbm/src/main/org/jpos/space persistent proxy tiny transient tspace tspace/src tspace/src/main tspace/src/main/org tspace/src/main/org/jpos tspace/src/main/org/jpos/space tspace/src/main/org/jpos/space/tspace util util/src/main/org/jpos/space/util, niclas, 02/08/2005

Archive powered by MHonArc 2.6.24.

Top of Page