fr.dyade.aaa.jndi2.impl
Class ServerImpl

java.lang.Object
  extended by fr.dyade.aaa.jndi2.impl.ServerImpl

public class ServerImpl
extends java.lang.Object


Field Summary
private  ContextManager contextManager
          A context manager for the factory operations (new, delete).
static java.lang.String LOOSE_COUPLING
           
static boolean looseCoupling
           
private  java.lang.Object rootOwnerId
          Identifier of the server that owns the root naming context.
private  java.lang.Object serverId
          Identifier of this server.
private  UpdateListener updateListener
          Optional update listener.
 
Constructor Summary
ServerImpl(Transaction transaction, java.lang.Object serverId, java.lang.Object rootOwnerId)
          Constructs a ServerImpl
 
Method Summary
 void addNamingContext(NamingContextInfo ncInfo)
           
 void bind(javax.naming.CompositeName path, java.lang.Object obj)
          Binds an object to the specified path.
 void bind(NamingContext nc, java.lang.String lastName, java.lang.Object obj, java.lang.Object ownerId)
           
 void changeOwner(javax.naming.CompositeName name, java.lang.Object newOwnerId)
           
 NamingContextInfo[] copyNamingContexts(java.lang.Object serverId)
          Returns copies of the naming contexts owned by the server which identifier is specified.
 void createSubcontext(javax.naming.CompositeName path)
           
 void createSubcontext(javax.naming.CompositeName path, java.lang.Object subcontextOwnerId)
          Create a subcontext.
 NamingContextId createSubcontext(NamingContext parentNc, java.lang.String lastName, javax.naming.CompositeName path, NamingContextId ncid, java.lang.Object subcontextOwnerId, java.lang.Object ownerId)
           
 void destroySubcontext(javax.naming.CompositeName path)
          Destroy a subcontext.
 boolean destroySubcontext(NamingContext parentNc, java.lang.String lastName, javax.naming.CompositeName path, java.lang.Object ownerId)
           
 NamingContext getNamingContext(javax.naming.CompositeName name)
           
 NamingContext getNamingContext(NamingContextId ncid)
           
 void initialize()
           
 javax.naming.NameClassPair[] list(javax.naming.CompositeName path)
           
 javax.naming.Binding[] listBindings(javax.naming.CompositeName path)
           
 Record lookup(javax.naming.CompositeName path)
          Looks up the specified path.
 NamingContext newNamingContext(java.lang.Object ownerId, NamingContextId ncid, javax.naming.CompositeName name)
           
 void readBag(java.io.ObjectInputStream in)
           
 void rebind(javax.naming.CompositeName path, java.lang.Object obj)
          Rebinds an object to the specified path.
 void rebind(NamingContext nc, java.lang.String lastName, java.lang.Object obj, java.lang.Object ownerId)
           
 void resetNamingContext(NamingContext context)
           
 void setUpdateListener(UpdateListener updateListener)
           
 void storeNamingContext(NamingContext nc)
           
 void unbind(javax.naming.CompositeName path)
          Unbinds the specified path.
 boolean unbind(NamingContext nc, java.lang.String lastName, java.lang.Object ownerId)
           
 void writeBag(java.io.ObjectOutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOOSE_COUPLING

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

looseCoupling

public static boolean looseCoupling

serverId

private java.lang.Object serverId
Identifier of this server.


rootOwnerId

private java.lang.Object rootOwnerId
Identifier of the server that owns the root naming context.


updateListener

private UpdateListener updateListener
Optional update listener. May be null.


contextManager

private ContextManager contextManager
A context manager for the factory operations (new, delete). It also handles a cache and the persistency.

Constructor Detail

ServerImpl

public ServerImpl(Transaction transaction,
                  java.lang.Object serverId,
                  java.lang.Object rootOwnerId)
Constructs a ServerImpl

Parameters:
transaction - Transactional context that provides atomicity for the write operations performed during a request.
serverId - Identifier of this server.
rootOwnerId - Identifier of the server that owns the root naming context.
Method Detail

setUpdateListener

public void setUpdateListener(UpdateListener updateListener)

initialize

public void initialize()
                throws java.lang.Exception
Throws:
java.lang.Exception

bind

public void bind(javax.naming.CompositeName path,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Binds an object to the specified path.

Parameters:
path - the path of the object
obj - the object to bind
Throws:
javax.naming.NameAlreadyBoundException - if the name of the subcontext is already bound.
javax.naming.NameNotFoundException - if some of the intermediate names in the path don't exist.
NotOwnerException - if the owner of the parent context is checked and is not the local naming server.
javax.naming.NamingException

bind

public void bind(NamingContext nc,
                 java.lang.String lastName,
                 java.lang.Object obj,
                 java.lang.Object ownerId)
          throws javax.naming.NamingException
Throws:
javax.naming.NamingException

rebind

public void rebind(javax.naming.CompositeName path,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Rebinds an object to the specified path.

Parameters:
path - the path of the object
obj - the object to rebind
Throws:
javax.naming.NameNotFoundException - if some of the intermediate names in the path don't exist.
NotOwnerException - if the owner of the parent context is checked and is not the local naming server.
javax.naming.NamingException - if the specified path is bound to a naming context.

rebind

public void rebind(NamingContext nc,
                   java.lang.String lastName,
                   java.lang.Object obj,
                   java.lang.Object ownerId)
            throws javax.naming.NamingException
Throws:
javax.naming.NamingException

lookup

public Record lookup(javax.naming.CompositeName path)
              throws javax.naming.NamingException
Looks up the specified path.

Parameters:
path - the path to look up
Returns:
null if the bound object is a context.
Throws:
javax.naming.NameNotFoundException - if some of the names (intermediate and final) in the path don't exist.
NotOwnerException - if the owner of the parent context is checked and is not the local naming server.
javax.naming.NameNotFoundException
javax.naming.NamingException

unbind

public void unbind(javax.naming.CompositeName path)
            throws javax.naming.NamingException
Unbinds the specified path. This operation is idempotent: does nothing if the final name of the path is not found.

Parameters:
path - the path to unbind
Throws:
javax.naming.NameNotFoundException - if some of the intermediate names in the path don't exist.
NotOwnerException - if the owner of the parent context is checked and is not the local naming server.
javax.naming.NamingException - if the specified path is bound to a naming context.

unbind

public boolean unbind(NamingContext nc,
                      java.lang.String lastName,
                      java.lang.Object ownerId)
               throws javax.naming.NamingException
Throws:
javax.naming.NamingException

list

public javax.naming.NameClassPair[] list(javax.naming.CompositeName path)
                                  throws javax.naming.NamingException
Throws:
javax.naming.NamingException

listBindings

public javax.naming.Binding[] listBindings(javax.naming.CompositeName path)
                                    throws javax.naming.NamingException
Throws:
javax.naming.NamingException

createSubcontext

public void createSubcontext(javax.naming.CompositeName path)
                      throws javax.naming.NamingException
Throws:
javax.naming.NamingException

createSubcontext

public void createSubcontext(javax.naming.CompositeName path,
                             java.lang.Object subcontextOwnerId)
                      throws javax.naming.NamingException
Create a subcontext.

Parameters:
path - the path of the subcontext
subcontextOwner - identifier of the owner of the subcontext (null if the owner is the local naming server).
Throws:
javax.naming.NameAlreadyBoundException - if the name of the subcontext is already bound.
javax.naming.NameNotFoundException - if some of the intermediate names in the path don't exist.
NotOwnerException - if the owner of the parent context is checked and is not the local naming server.
javax.naming.NamingException

createSubcontext

public NamingContextId createSubcontext(NamingContext parentNc,
                                        java.lang.String lastName,
                                        javax.naming.CompositeName path,
                                        NamingContextId ncid,
                                        java.lang.Object subcontextOwnerId,
                                        java.lang.Object ownerId)
                                 throws javax.naming.NamingException
Throws:
javax.naming.NamingException

destroySubcontext

public void destroySubcontext(javax.naming.CompositeName path)
                       throws javax.naming.NamingException
Destroy a subcontext. This operation is idempotent: does nothing if the final name of the path is not found.

Parameters:
path - the path of the subcontext
Throws:
javax.naming.NameAlreadyBoundException - if the name of the subcontext is already bound.
javax.naming.NameNotFoundException - if some of the intermediate names in the path don't exist.
NotOwnerException - if the owner of the parent context is checked and is not the local naming server.
javax.naming.NotContextException - if the specified path isn't bound to a context.
javax.naming.NamingException

destroySubcontext

public boolean destroySubcontext(NamingContext parentNc,
                                 java.lang.String lastName,
                                 javax.naming.CompositeName path,
                                 java.lang.Object ownerId)
                          throws javax.naming.NamingException
Throws:
javax.naming.NamingException

copyNamingContexts

public NamingContextInfo[] copyNamingContexts(java.lang.Object serverId)
                                       throws javax.naming.NamingException
Returns copies of the naming contexts owned by the server which identifier is specified.

Parameters:
serverId - the identifier of the server that owns the naming contexts to get.
Throws:
javax.naming.NamingException

getNamingContext

public NamingContext getNamingContext(NamingContextId ncid)
                               throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getNamingContext

public NamingContext getNamingContext(javax.naming.CompositeName name)
                               throws javax.naming.NamingException
Throws:
javax.naming.NamingException

storeNamingContext

public void storeNamingContext(NamingContext nc)
                        throws javax.naming.NamingException
Throws:
javax.naming.NamingException

addNamingContext

public void addNamingContext(NamingContextInfo ncInfo)
                      throws javax.naming.NamingException
Throws:
javax.naming.NamingException

newNamingContext

public NamingContext newNamingContext(java.lang.Object ownerId,
                                      NamingContextId ncid,
                                      javax.naming.CompositeName name)
                               throws javax.naming.NamingException
Throws:
javax.naming.NamingException

changeOwner

public void changeOwner(javax.naming.CompositeName name,
                        java.lang.Object newOwnerId)
                 throws javax.naming.NamingException
Throws:
javax.naming.NamingException

resetNamingContext

public void resetNamingContext(NamingContext context)
                        throws javax.naming.NamingException
Throws:
javax.naming.NamingException

writeBag

public void writeBag(java.io.ObjectOutputStream out)
              throws java.io.IOException
Throws:
java.io.IOException

readBag

public void readBag(java.io.ObjectInputStream in)
             throws java.io.IOException,
                    java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.