org.ow2.petals.communication.jndi.agent.util
Class RegistryUtil

java.lang.Object
  extended by org.ow2.petals.communication.jndi.agent.util.RegistryUtil

public class RegistryUtil
extends java.lang.Object

Utility class to handle data.

Author:
ddesjardins - eBMWebsourcing

Constructor Summary
RegistryUtil(AbstractJNDIAgentServiceImpl jndiAgentServiceImpl)
          Creates a new instance of RegistryUtil
 
Method Summary
 void bind(java.lang.Object contextName, java.lang.Object key, java.lang.Object value)
          Bind an object with a key in the specified context
 java.lang.String createSubcontext(java.lang.Object contextName, java.lang.Object key)
          Create and bind a new context in the specified context
 void destroySubcontext(java.lang.Object contextName, java.lang.Object key)
          Destroy a subcontext in the specified context
 javax.naming.NameClassPair[] list(java.lang.Object contextName, java.lang.Object key)
          List the content of a context
 javax.naming.Binding[] listBindings(java.lang.Object contextName, java.lang.Object key, boolean localConnection)
          List the bindings of a context
 java.io.Serializable lookup(java.lang.Object contextName, java.lang.Object key, boolean localConnection)
          Lookup for an object
 java.lang.Object lookupLink(java.lang.Object contextName, java.lang.Object key, boolean localConnection)
          Lookup for an object go through the links if the object found is a link
 void rebind(java.lang.Object contextName, java.lang.Object key, java.lang.Object value)
          Rebind an object with a key in the specified context
 void rename(java.lang.Object contextName, java.lang.Object oldKey, java.lang.Object newKey, boolean localConnection)
          Rename an object with a key in the specified context
 void unbind(java.lang.Object contextName, java.lang.Object key)
          Unbind an object from a Context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryUtil

public RegistryUtil(AbstractJNDIAgentServiceImpl jndiAgentServiceImpl)
Creates a new instance of RegistryUtil

Parameters:
server -
Method Detail

bind

public void bind(java.lang.Object contextName,
                 java.lang.Object key,
                 java.lang.Object value)
          throws javax.naming.NamingException
Bind an object with a key in the specified context

Parameters:
contextName - name of the context
key - key to bind with
value - value to bind to the key
Throws:
javax.naming.NamingException - if a problem occurs

createSubcontext

public java.lang.String createSubcontext(java.lang.Object contextName,
                                         java.lang.Object key)
                                  throws javax.naming.NamingException
Create and bind a new context in the specified context

Parameters:
contextName - name of the context in which we want to create a new context
key - name of the context that we want to create
Returns:
newly created context
Throws:
javax.naming.NamingException - if the context name does not exist or if the key is already bound

destroySubcontext

public void destroySubcontext(java.lang.Object contextName,
                              java.lang.Object key)
                       throws javax.naming.NamingException
Destroy a subcontext in the specified context

Parameters:
contextName - name of the context in which we want to create a new context
key - name of the context that we want to create
Throws:
javax.naming.NamingException - if the context name does not exist or if the key is already bound

list

public javax.naming.NameClassPair[] list(java.lang.Object contextName,
                                         java.lang.Object key)
                                  throws javax.naming.NamingException
List the content of a context

Parameters:
contextName - name of the context
contextToList - name of the context to list the content
Returns:
array of NameClassPair
Throws:
javax.naming.NamingException

listBindings

public javax.naming.Binding[] listBindings(java.lang.Object contextName,
                                           java.lang.Object key,
                                           boolean localConnection)
                                    throws javax.naming.NamingException
List the bindings of a context

Parameters:
contextName - name of the context
contextToList - name of the context to list the content
localConnection - true if the connection is local
Returns:
array of NameClassPair
Throws:
javax.naming.NamingException

lookup

public java.io.Serializable lookup(java.lang.Object contextName,
                                   java.lang.Object key,
                                   boolean localConnection)
                            throws javax.naming.NamingException
Lookup for an object

Parameters:
contextName - name of the context
key - key to look for
localConnection - true if the connection is local
Returns:
value of the object bound to the key
Throws:
javax.naming.NamingException

lookupLink

public java.lang.Object lookupLink(java.lang.Object contextName,
                                   java.lang.Object key,
                                   boolean localConnection)
                            throws javax.naming.NamingException
Lookup for an object go through the links if the object found is a link

Parameters:
contextName - name of the context
key - key to look for
localConnection - true if the connection is local
Returns:
value of the object bound to the key
Throws:
javax.naming.NamingException

rebind

public void rebind(java.lang.Object contextName,
                   java.lang.Object key,
                   java.lang.Object value)
            throws javax.naming.NamingException
Rebind an object with a key in the specified context

Parameters:
data - data
contextName - name of the context
key - key to bind with
value - value to bind to the key
Throws:
javax.naming.NamingException - if a problem occurs

rename

public void rename(java.lang.Object contextName,
                   java.lang.Object oldKey,
                   java.lang.Object newKey,
                   boolean localConnection)
            throws javax.naming.NamingException
Rename an object with a key in the specified context

Parameters:
contextName - name of the context
oldKey - old key
newKey - new key to bind to
localConnection - true if the connection is local
Throws:
javax.naming.NamingException - if a problem occurs

unbind

public void unbind(java.lang.Object contextName,
                   java.lang.Object key)
            throws javax.naming.NamingException
Unbind an object from a Context

Parameters:
contextName - name of the context in which we work
key - key to unbind
Throws:
javax.naming.NamingException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.