Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.slide.store.mem
Class AbstractTransientStore  view AbstractTransientStore download AbstractTransientStore.java

java.lang.Object
  extended byorg.apache.slide.common.AbstractServiceBase
      extended byorg.apache.slide.store.mem.AbstractTransientStore
All Implemented Interfaces:
org.apache.slide.common.Service, javax.transaction.xa.XAResource
Direct Known Subclasses:
TransientContentStore, TransientDescriptorsStore, TransientDescriptorStore, TransientLockStore, TransientNodeStore, TransientSecurityStore

public abstract class AbstractTransientStore
extends org.apache.slide.common.AbstractServiceBase

Base class for the stores that what to store its data transient in a map.

Implementations access the backing map only via put(Object, Object) 55 , get(Object) 55 and remove(Object) 55 .

The backed map can be any class that is derived from org.apache.commons.transaction.memory.TransactionalMapWrapper.

The class may be configured in the domain.xml using the parameter map-classname. Default is org.apache.commons.transaction.memory.OptimisticMapWrapper.


Nested Class Summary
protected static class AbstractTransientStore.IteratorEnum
          Enumeration wrapper for an Iterator.
 
Field Summary
protected static java.util.Enumeration EMPTY_ENUM
          Empty enumeration.
private  boolean isConnected
           
(package private) static java.lang.String MAP_IMPL_PARAMETER
           
(package private) static java.lang.String MAP_IMPL_PARAMETER_DEFAULT
           
private  java.util.Map parameters
           
private  org.apache.commons.transaction.memory.TransactionalMapWrapper store
          The map containing the stored content.
private  org.apache.commons.transaction.memory.jca.MapXAResource xaResource
          The XAResource to delegate all XA requests.
 
Fields inherited from class org.apache.slide.common.AbstractServiceBase
LOG_CHANNEL, namespace, scope
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Constructor Summary
AbstractTransientStore()
           
 
Method Summary
 void commit(javax.transaction.xa.Xid xid, boolean onePhase)
           
 void connect()
          Connects to the underlying data source (if any is needed).
protected  void debug(java.lang.String msg, java.lang.Object o)
           
protected  void debug(java.lang.String msg, java.lang.Object o1, java.lang.Object o2)
           
 void disconnect()
          Disconnects from the underlying data source.
 void end(javax.transaction.xa.Xid xid, int flags)
           
private  void error(java.lang.String msg, java.lang.Throwable t)
           
 void forget(javax.transaction.xa.Xid xid)
           
protected  java.lang.Object get(java.lang.Object key)
           
protected  java.lang.String getParameter(java.lang.String name)
           
 int getTransactionTimeout()
           
private  void info(java.lang.String msg, java.lang.Object o1, java.lang.Object o2)
           
 void initialize(org.apache.slide.common.NamespaceAccessToken token)
          Initializes service.
 boolean isConnected()
          This function tells whether or not the service is connected.
 boolean isSameRM(javax.transaction.xa.XAResource xares)
           
protected  java.lang.String LogChannel()
           
 int prepare(javax.transaction.xa.Xid xid)
           
protected  void put(java.lang.Object key, java.lang.Object value)
           
 javax.transaction.xa.Xid[] recover(int flag)
           
protected  java.lang.Object remove(java.lang.Object key)
           
 void reset()
          Deletes service underlying data source, if possible (and meaningful).
 void rollback(javax.transaction.xa.Xid xid)
           
 void setParameters(java.util.Hashtable parameters)
          Initializes the service with a set of parameters.
 boolean setTransactionTimeout(int seconds)
           
 void start(javax.transaction.xa.Xid xid, int flags)
           
 
Methods inherited from class org.apache.slide.common.AbstractServiceBase
cacheResults, connect, connectIfNeeded, connectIfNeeded, getLogger, setNamespace, setScope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAP_IMPL_PARAMETER

static final java.lang.String MAP_IMPL_PARAMETER
See Also:
Constant Field Values

MAP_IMPL_PARAMETER_DEFAULT

static final java.lang.String MAP_IMPL_PARAMETER_DEFAULT
See Also:
Constant Field Values

parameters

private java.util.Map parameters

isConnected

private boolean isConnected

store

private org.apache.commons.transaction.memory.TransactionalMapWrapper store
The map containing the stored content.


xaResource

private org.apache.commons.transaction.memory.jca.MapXAResource xaResource
The XAResource to delegate all XA requests.


EMPTY_ENUM

protected static java.util.Enumeration EMPTY_ENUM
Empty enumeration.

Constructor Detail

AbstractTransientStore

public AbstractTransientStore()
Method Detail

start

public void start(javax.transaction.xa.Xid xid,
                  int flags)
           throws javax.transaction.xa.XAException

commit

public void commit(javax.transaction.xa.Xid xid,
                   boolean onePhase)
            throws javax.transaction.xa.XAException

prepare

public int prepare(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException

end

public void end(javax.transaction.xa.Xid xid,
                int flags)
         throws javax.transaction.xa.XAException

rollback

public void rollback(javax.transaction.xa.Xid xid)
              throws javax.transaction.xa.XAException

recover

public javax.transaction.xa.Xid[] recover(int flag)
                                   throws javax.transaction.xa.XAException

forget

public void forget(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException

getTransactionTimeout

public int getTransactionTimeout()
                          throws javax.transaction.xa.XAException

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)
                              throws javax.transaction.xa.XAException

isSameRM

public boolean isSameRM(javax.transaction.xa.XAResource xares)
                 throws javax.transaction.xa.XAException

put

protected void put(java.lang.Object key,
                   java.lang.Object value)

get

protected java.lang.Object get(java.lang.Object key)

remove

protected java.lang.Object remove(java.lang.Object key)

setParameters

public void setParameters(java.util.Hashtable parameters)
                   throws org.apache.slide.common.ServiceParameterErrorException,
                          org.apache.slide.common.ServiceParameterMissingException
Description copied from class: org.apache.slide.common.AbstractServiceBase
Initializes the service with a set of parameters. Those could be :
  • User name, login info
  • Host name on which to connect
  • Remote port
  • JDBC driver whoich is to be used :-)
  • Anything else ...


  • getParameter

    protected java.lang.String getParameter(java.lang.String name)

    initialize

    public void initialize(org.apache.slide.common.NamespaceAccessToken token)
                    throws org.apache.slide.common.ServiceInitializationFailedException
    Description copied from class: org.apache.slide.common.AbstractServiceBase
    Initializes service.


    connect

    public void connect()
                 throws org.apache.slide.common.ServiceConnectionFailedException
    Description copied from class: org.apache.slide.common.AbstractServiceBase
    Connects to the underlying data source (if any is needed).


    disconnect

    public void disconnect()
                    throws org.apache.slide.common.ServiceDisconnectionFailedException
    Description copied from class: org.apache.slide.common.AbstractServiceBase
    Disconnects from the underlying data source.


    reset

    public void reset()
               throws org.apache.slide.common.ServiceResetFailedException
    Description copied from class: org.apache.slide.common.AbstractServiceBase
    Deletes service underlying data source, if possible (and meaningful).


    isConnected

    public boolean isConnected()
                        throws org.apache.slide.common.ServiceAccessException
    Description copied from class: org.apache.slide.common.AbstractServiceBase
    This function tells whether or not the service is connected.


    LogChannel

    protected java.lang.String LogChannel()

    debug

    protected void debug(java.lang.String msg,
                         java.lang.Object o)

    debug

    protected void debug(java.lang.String msg,
                         java.lang.Object o1,
                         java.lang.Object o2)

    info

    private void info(java.lang.String msg,
                      java.lang.Object o1,
                      java.lang.Object o2)

    error

    private void error(java.lang.String msg,
                       java.lang.Throwable t)