JSlim  


com.gtcgroup.jslim
Class JSlimInitialContext

java.lang.Object
  extended byjavax.naming.InitialContext
      extended bycom.gtcgroup.jslim.JSlimInitialContext
All Implemented Interfaces:
javax.naming.Context, IJSlimCachable, IJSlimPoolable

public class JSlimInitialContext
extends javax.naming.InitialContext
implements IJSlimPoolable

This class extends InitialContext in order to override methods throwing a NamingException. If an exception is thrown, all cached objects are discarded preventing further use. The typical scenario supported is the unavailability of a previously available remote resource.

Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.

Since:
v. 1.0
Author:
MDT (MarvinToll@gtcGroup.com)

Field Summary
private  int intUrlSelected
          Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
private  ServiceKeyVO serviceKeyVO
          A portion of a descriptor document representing one service.
 
Fields inherited from class javax.naming.InitialContext
defaultInitCtx, gotDefault, myProps
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
(package private) JSlimInitialContext(java.util.Hashtable environment, ServiceKeyVO serviceKeyVO, int intUrlSelected)
          Constructs an initial context using the supplied environment.
(package private) JSlimInitialContext(ServiceKeyVO serviceKeyVO)
          Constructs an initial context.
(package private) JSlimInitialContext(ServiceKeyVO serviceKeyVO, int intUrlSelected)
          Constructs an initial context.
 
Method Summary
 java.lang.Object addToEnvironment(java.lang.String propName, java.lang.Object propVal)
           
 void bind(javax.naming.Name name, java.lang.Object obj)
           
 void bind(java.lang.String name, java.lang.Object obj)
           
 void close()
           
 javax.naming.Context createSubcontext(javax.naming.Name name)
           
 javax.naming.Context createSubcontext(java.lang.String name)
           
 void destroySubcontext(javax.naming.Name name)
           
 void destroySubcontext(java.lang.String name)
           
 boolean equals(java.lang.Object o)
           
 java.util.Hashtable getEnvironment()
           
 java.lang.String getNameInNamespace()
           
 javax.naming.NameParser getNameParser(javax.naming.Name name)
           
 javax.naming.NameParser getNameParser(java.lang.String name)
           
 java.lang.String getServiceKey()
          Returns the service key associated with this object.
 int getServiceType()
          Returns the service type associated with this object.
 int getUrlSelected()
          Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
 int hashCode()
           
 javax.naming.NamingEnumeration list(javax.naming.Name name)
           
 javax.naming.NamingEnumeration list(java.lang.String name)
           
 javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
           
 javax.naming.NamingEnumeration listBindings(java.lang.String name)
           
 java.lang.Object lookup(javax.naming.Name name)
           
 java.lang.Object lookup(java.lang.String name)
           
 java.lang.Object lookupLink(javax.naming.Name name)
           
 java.lang.Object lookupLink(java.lang.String name)
           
 void rebind(javax.naming.Name name, java.lang.Object obj)
           
 void rebind(java.lang.String name, java.lang.Object obj)
           
 java.lang.Object removeFromEnvironment(java.lang.String propName)
           
 void rename(javax.naming.Name oldName, javax.naming.Name newName)
           
 void rename(java.lang.String oldName, java.lang.String newName)
           
private  java.lang.Object rethrowNamingException(javax.naming.NamingException e)
           
 void unbind(javax.naming.Name name)
           
 void unbind(java.lang.String name)
           
 
Methods inherited from class javax.naming.InitialContext
composeName, composeName, getDefaultInitCtx, getURLOrDefaultInitCtx, getURLOrDefaultInitCtx, init
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceKeyVO

private final ServiceKeyVO serviceKeyVO
A portion of a descriptor document representing one service.


intUrlSelected

private final int intUrlSelected
Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

Constructor Detail

JSlimInitialContext

JSlimInitialContext(ServiceKeyVO serviceKeyVO)
              throws javax.naming.NamingException
Constructs an initial context. No environment properties are supplied. Equivalent to new InitialContext(null).

Parameters:
serviceKeyVO - A portion of a descriptor document representing one service.
Throws:
javax.naming.NamingException - if a naming exception is encountered

JSlimInitialContext

JSlimInitialContext(ServiceKeyVO serviceKeyVO,
                    int intUrlSelected)
              throws javax.naming.NamingException
Constructs an initial context. No environment properties are supplied. Equivalent to new InitialContext(null).

Parameters:
serviceKeyVO - A portion of a descriptor document representing one service.
intUrlSelected - Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
Throws:
javax.naming.NamingException - if a naming exception is encountered

JSlimInitialContext

JSlimInitialContext(java.util.Hashtable environment,
                    ServiceKeyVO serviceKeyVO,
                    int intUrlSelected)
              throws javax.naming.NamingException
Constructs an initial context using the supplied environment. Environment properties are discussed in the class description.

This constructor will not modify environment or save a reference to it, but may save a clone.

Parameters:
environment - environment used to create the initial context. Null indicates an empty environment.
serviceKeyVO - A portion of a descriptor document representing one service.
intUrlSelected - Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
Throws:
javax.naming.NamingException - if a naming exception is encountered
Method Detail

getServiceKey

public final java.lang.String getServiceKey()
Returns the service key associated with this object.

Specified by:
getServiceKey in interface IJSlimPoolable
Returns:
The service key associated with this object.

getServiceType

public final int getServiceType()
Returns the service type associated with this object.

Specified by:
getServiceType in interface IJSlimPoolable
Returns:
The service type associated with this object.

getUrlSelected

public final int getUrlSelected()
Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

Specified by:
getUrlSelected in interface IJSlimCachable
Returns:
Which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

close

public final void close()
                 throws javax.naming.NamingException
Specified by:
close in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameInNamespace

public final java.lang.String getNameInNamespace()
                                          throws javax.naming.NamingException
Specified by:
getNameInNamespace in interface javax.naming.Context
Throws:
javax.naming.NamingException

destroySubcontext

public final void destroySubcontext(java.lang.String name)
                             throws javax.naming.NamingException
Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

unbind

public final void unbind(java.lang.String name)
                  throws javax.naming.NamingException
Specified by:
unbind in interface javax.naming.Context
Throws:
javax.naming.NamingException

getEnvironment

public final java.util.Hashtable getEnvironment()
                                         throws javax.naming.NamingException
Specified by:
getEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException

destroySubcontext

public final void destroySubcontext(javax.naming.Name name)
                             throws javax.naming.NamingException
Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

unbind

public final void unbind(javax.naming.Name name)
                  throws javax.naming.NamingException
Specified by:
unbind in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookup

public java.lang.Object lookup(java.lang.String name)
                        throws javax.naming.NamingException
Specified by:
lookup in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookupLink

public final java.lang.Object lookupLink(java.lang.String name)
                                  throws javax.naming.NamingException
Specified by:
lookupLink in interface javax.naming.Context
Throws:
javax.naming.NamingException

removeFromEnvironment

public final java.lang.Object removeFromEnvironment(java.lang.String propName)
                                             throws javax.naming.NamingException
Specified by:
removeFromEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException

bind

public final void bind(java.lang.String name,
                       java.lang.Object obj)
                throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException

rebind

public final void rebind(java.lang.String name,
                         java.lang.Object obj)
                  throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookup

public final java.lang.Object lookup(javax.naming.Name name)
                              throws javax.naming.NamingException
Specified by:
lookup in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookupLink

public final java.lang.Object lookupLink(javax.naming.Name name)
                                  throws javax.naming.NamingException
Specified by:
lookupLink in interface javax.naming.Context
Throws:
javax.naming.NamingException

bind

public final void bind(javax.naming.Name name,
                       java.lang.Object obj)
                throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException

rebind

public final void rebind(javax.naming.Name name,
                         java.lang.Object obj)
                  throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException

rename

public final void rename(java.lang.String oldName,
                         java.lang.String newName)
                  throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException

createSubcontext

public final javax.naming.Context createSubcontext(java.lang.String name)
                                            throws javax.naming.NamingException
Specified by:
createSubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

createSubcontext

public final javax.naming.Context createSubcontext(javax.naming.Name name)
                                            throws javax.naming.NamingException
Specified by:
createSubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

rename

public final void rename(javax.naming.Name oldName,
                         javax.naming.Name newName)
                  throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameParser

public final javax.naming.NameParser getNameParser(java.lang.String name)
                                            throws javax.naming.NamingException
Specified by:
getNameParser in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameParser

public final javax.naming.NameParser getNameParser(javax.naming.Name name)
                                            throws javax.naming.NamingException
Specified by:
getNameParser in interface javax.naming.Context
Throws:
javax.naming.NamingException

list

public final javax.naming.NamingEnumeration list(java.lang.String name)
                                          throws javax.naming.NamingException
Specified by:
list in interface javax.naming.Context
Throws:
javax.naming.NamingException

listBindings

public final javax.naming.NamingEnumeration listBindings(java.lang.String name)
                                                  throws javax.naming.NamingException
Specified by:
listBindings in interface javax.naming.Context
Throws:
javax.naming.NamingException

list

public final javax.naming.NamingEnumeration list(javax.naming.Name name)
                                          throws javax.naming.NamingException
Specified by:
list in interface javax.naming.Context
Throws:
javax.naming.NamingException

listBindings

public final javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
                                                  throws javax.naming.NamingException
Specified by:
listBindings in interface javax.naming.Context
Throws:
javax.naming.NamingException

addToEnvironment

public final java.lang.Object addToEnvironment(java.lang.String propName,
                                               java.lang.Object propVal)
                                        throws javax.naming.NamingException
Specified by:
addToEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException

rethrowNamingException

private java.lang.Object rethrowNamingException(javax.naming.NamingException e)
                                         throws javax.naming.NamingException
Throws:
javax.naming.NamingException

equals

public final boolean equals(java.lang.Object o)

hashCode

public final int hashCode()

JSlim  


Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.