org.codehaus.wadi.core.util
Class Utils

java.lang.Object
  extended by org.codehaus.wadi.core.util.Utils

public class Utils
extends java.lang.Object

A collection of useful static functions

Version:
$Revision: 2415 $
Author:
Jules Gosnell

Field Summary
protected static org.apache.commons.logging.Log _lockLog
           
protected static org.apache.commons.logging.Log _log
           
 
Constructor Summary
Utils()
           
 
Method Summary
static void acquireUninterrupted(java.lang.String lockType, java.lang.String lockName, java.util.concurrent.locks.Lock sync)
           
static byte[] getContent(java.io.Externalizable object, Streamer streamer)
           
static Motable mote(Emoter emoter, Immoter immoter, Motable emotable, java.lang.String name)
          Mote (in other words - move) the data held in a Motable from one Contextualiser to another, such that if the two Contextualisers store Motables in a persistant fashion, the data is never present in less than one of the two.
static void release(java.lang.String lockType, java.lang.String lockName, java.util.concurrent.locks.Lock sync)
           
static java.io.Externalizable setContent(java.io.Externalizable object, byte[] content, Streamer streamer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

protected static final org.apache.commons.logging.Log _log

_lockLog

protected static final org.apache.commons.logging.Log _lockLog
Constructor Detail

Utils

public Utils()
Method Detail

mote

public static Motable mote(Emoter emoter,
                           Immoter immoter,
                           Motable emotable,
                           java.lang.String name)
Mote (in other words - move) the data held in a Motable from one Contextualiser to another, such that if the two Contextualisers store Motables in a persistant fashion, the data is never present in less than one of the two.

Parameters:
emoter - - delegate for the source Contextualiser
immoter - - delegate for the target Contextualiser
emotable - - data to be moved
name - - the id of said data
Returns:
- the resulting immotable - in other words - the data's new representation in the target Contextualiser

acquireUninterrupted

public static void acquireUninterrupted(java.lang.String lockType,
                                        java.lang.String lockName,
                                        java.util.concurrent.locks.Lock sync)
                                 throws java.util.concurrent.TimeoutException
Throws:
java.util.concurrent.TimeoutException

release

public static void release(java.lang.String lockType,
                           java.lang.String lockName,
                           java.util.concurrent.locks.Lock sync)

getContent

public static byte[] getContent(java.io.Externalizable object,
                                Streamer streamer)
                         throws java.io.IOException
Throws:
java.io.IOException

setContent

public static java.io.Externalizable setContent(java.io.Externalizable object,
                                                byte[] content,
                                                Streamer streamer)
                                         throws java.io.IOException,
                                                java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException


Copyright © 2010. All Rights Reserved.