ADK CVS

tryllian.are.persistence.spi
Interface JNDIPersistencePlugin


public interface JNDIPersistencePlugin

The JNDIPersistencePlugin handles the persistent storage needs of the JNDI component of the ARE.


Field Summary
static java.lang.String BINDING_PROTECT
           
static java.lang.String BINDING_UNPROTECTED
           
static java.lang.String CONTEXT_OBJECT
           
 
Method Summary
 void bind(java.lang.String context, java.lang.String name, java.lang.String object, java.lang.String protect, Transaction transaction)
          Binds object under name in the context context.
 void clean(java.lang.String contextPrefix, Transaction transaction)
          Removes all bindings from the backend.
 void createSubcontext(java.lang.String parentContext, java.lang.String name, java.lang.String completeName, Transaction transaction)
          Create a new subcontext.
 void destroySubcontext(java.lang.String parentContext, java.lang.String name, java.lang.String completeName, Transaction transaction)
          Destroy an existing subcontext.
 void dropProtection(java.lang.String context, java.lang.String name, Transaction action)
           
 void gc(Transaction action)
           
 java.util.List getBindings(java.lang.String parentContext, java.lang.String context, Transaction transaction)
          Returns a List containing Binding objects for every binding in the specified context.
 boolean isContext(java.lang.String parent, java.lang.String name, Transaction transaction)
          Returns true if the specified name is bound to a context.
 java.lang.String lookup(java.lang.String context, java.lang.String name, Transaction transaction)
          Returns the string bound to the specified name in the specified context.
 void rebind(java.lang.String context, java.lang.String name, java.lang.String object, java.lang.String protect, Transaction transaction)
          Rebinds an object.
 void unbind(java.lang.String context, java.lang.String name, Transaction transaction)
          Unbinds an object.
 void unbindAll(java.lang.String object, Transaction transaction)
          Removes all bindings to the specified object.
 

Field Detail

CONTEXT_OBJECT

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

BINDING_PROTECT

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

BINDING_UNPROTECTED

public static final java.lang.String BINDING_UNPROTECTED
See Also:
Constant Field Values
Method Detail

gc

public void gc(Transaction action)
        throws PersistenceException
Throws:
PersistenceException

bind

public void bind(java.lang.String context,
                 java.lang.String name,
                 java.lang.String object,
                 java.lang.String protect,
                 Transaction transaction)
          throws javax.naming.NamingException
Binds object under name in the context context.

Parameters:
context - the fully qualified name of the context in which the object should be bound
name - the name under which the object should be bound
object - the string representation of the object to bind
transaction - the transaction within which the action should take place.
Throws:
javax.naming.NamingException - if the name is already bound, or if an error internal to the plug-in occurred

createSubcontext

public void createSubcontext(java.lang.String parentContext,
                             java.lang.String name,
                             java.lang.String completeName,
                             Transaction transaction)
                      throws javax.naming.NamingException
Create a new subcontext. This method returns nothing, since it is the responsibility of the front-end to create the appropriate context. This method is merely used to create the necessary datastructures in the backend.

The name of the subcontext is specified both as the complete name and as the (parent, name) pair, so the plug-in does not need to know about concatenating names.

Parameters:
parentContext - the fully qualified name of the context of the new subcontext's parent
name - the unqualified name of the new subcontext
completeName - the completely qualified name of the new subcontext
transaction - the transaction within which the action should take place.
Throws:
javax.naming.NamingException - if the name is already used (either for a bound object or for another context, or if an error internal to the plugin occurred

destroySubcontext

public void destroySubcontext(java.lang.String parentContext,
                              java.lang.String name,
                              java.lang.String completeName,
                              Transaction transaction)
                       throws javax.naming.NamingException
Destroy an existing subcontext. The name of the subcontext is specified both as the complete name and as the (parent, name) pair, so the plug-in does not need to know about concatenating names.

If the name is not bound, this method fails silently.

Parameters:
parentContext - the fully qualified name of the context of the destroyed subcontext's parent
name - the name of the subcontext to be destroyed
completeName - the fully qualified name of the subcontext to destroy
transaction - the transaction within which the action should take place.
Throws:
javax.naming.NamingException - if name was bound to something that is not a context or if an error internal to the plugin occurred

getBindings

public java.util.List getBindings(java.lang.String parentContext,
                                  java.lang.String context,
                                  Transaction transaction)
                           throws javax.naming.NamingException
Returns a List containing Binding objects for every binding in the specified context. Once returned, these bindings should be completely independent of the plug-in. The result of getObject should be identical to the result one would get when doing a lookup on the name of that binding. The classname of the binding will be set by the front-end

Parameters:
parentContext - the fully qualified name of the parent of the context for which the bindings should be generated
context - the unqualified name of the context for which the bindings should be generated
transaction - the transaction within which the action should take place.
Throws:
javax.naming.NamingException - if the context was not bound, or if an error internal to the plug-in occurred.

isContext

public boolean isContext(java.lang.String parent,
                         java.lang.String name,
                         Transaction transaction)
                  throws javax.naming.NamingException
Returns true if the specified name is bound to a context.

Parameters:
parent - the context's parent context
name - the name of the context
transaction - the action within which the action should take place
Throws:
javax.naming.NamingException - if the name is not bound, or if an internal error occurred.

lookup

public java.lang.String lookup(java.lang.String context,
                               java.lang.String name,
                               Transaction transaction)
                        throws javax.naming.NamingException
Returns the string bound to the specified name in the specified context.

Parameters:
context - the fully qualified name of the context in which to lookup
name - the name of the object to search for
transaction - the transaction within which the action should take place.
Returns:
if name was previously bound to a string s , this method returns that s . If name was used to create a subcontext, this method should return the symbolic constant CONTEXT_OBJECT
Throws:
javax.naming.NamingException - if the name was not bound, or if an error internal to the plug-in occurred.

rebind

public void rebind(java.lang.String context,
                   java.lang.String name,
                   java.lang.String object,
                   java.lang.String protect,
                   Transaction transaction)
            throws javax.naming.NamingException
Rebinds an object.

Parameters:
context - the fully qualified name of the context in which to rebind.
name - the name of the object to rebind
object - the new value of the object bound to name.
transaction - the transaction within which the action should take place.
Throws:
javax.naming.NamingException - if the object identified by 'name' was bound to a context, or if an error internal to the plug-in occurred.

unbind

public void unbind(java.lang.String context,
                   java.lang.String name,
                   Transaction transaction)
            throws javax.naming.NamingException
Unbinds an object. If the object was not bound, this method fails silently.

Parameters:
context - the fully qualified name of the context in which to unbind.
name - the unqualified name of the object to unbind
transaction - the transaction within which the action should take place.
Throws:
javax.naming.NamingException - if the object is a context, or if an error internal to the plug-in occurred.

dropProtection

public void dropProtection(java.lang.String context,
                           java.lang.String name,
                           Transaction action)
                    throws javax.naming.NamingException
Throws:
javax.naming.NamingException

unbindAll

public void unbindAll(java.lang.String object,
                      Transaction transaction)
               throws javax.naming.NamingException
Removes all bindings to the specified object. If the object was not bound at all, this method does not throw an exception.

Parameters:
object - the bound object that should be removed
transaction - the transaction within which the action should take place.
Throws:
javax.naming.NamingException - if an error internal to the plug-in occurred.

clean

public void clean(java.lang.String contextPrefix,
                  Transaction transaction)
           throws javax.naming.NamingException
Removes all bindings from the backend.

Parameters:
contextPrefix - the prefix of all contexts that should be removed.
transaction - the transaction within which the action should take place.
Throws:
javax.naming.NamingException - if an error internal to the plug-in occurred.

Copyright 2005, Tryllian Solutions B.V.