org.openejb.client
Class JNDIContext

java.lang.Object
  extended by org.openejb.client.JNDIContext
All Implemented Interfaces:
Serializable, Context, InitialContextFactory, RequestMethods, ResponseCodes
Direct Known Subclasses:
RemoteInitialContextFactory

public class JNDIContext
extends Object
implements Serializable, InitialContextFactory, Context, RequestMethods, ResponseCodes

JNDI client

Since:
11/25/2001
Author:
David Blevins
See Also:
Serialized Form

Field Summary
 
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
 
Fields inherited from interface org.openejb.client.RequestMethods
AUTH_REQUEST, EJB_HOME_CREATE, EJB_HOME_FIND, EJB_HOME_GET_EJB_META_DATA, EJB_HOME_GET_HOME_HANDLE, EJB_HOME_REMOVE_BY_HANDLE, EJB_HOME_REMOVE_BY_PKEY, EJB_OBJECT_BUSINESS_METHOD, EJB_OBJECT_GET_EJB_HOME, EJB_OBJECT_GET_HANDLE, EJB_OBJECT_GET_PRIMARY_KEY, EJB_OBJECT_IS_IDENTICAL, EJB_OBJECT_REMOVE, EJB_REQUEST, JNDI_LIST, JNDI_LIST_BINDINGS, JNDI_LOOKUP, JNDI_REQUEST, STOP_REQUEST_quit, STOP_REQUEST_Quit, STOP_REQUEST_stop, STOP_REQUEST_Stop
 
Fields inherited from interface org.openejb.client.ResponseCodes
AUTH_DENIED, AUTH_GRANTED, AUTH_REDIRECT, EJB_APP_EXCEPTION, EJB_ERROR, EJB_OK, EJB_OK_CREATE, EJB_OK_FOUND, EJB_OK_FOUND_COLLECTION, EJB_OK_FOUND_ENUMERATION, EJB_OK_NOT_FOUND, EJB_SYS_EXCEPTION, JNDI_CONTEXT, JNDI_EJBHOME, JNDI_ENUMERATION, JNDI_ERROR, JNDI_NAMING_EXCEPTION, JNDI_NOT_FOUND, JNDI_OK, JNDI_RUNTIME_EXCEPTION
 
Constructor Summary
JNDIContext()
           
JNDIContext(JNDIContext that)
           
 
Method Summary
 Object addToEnvironment(String key, Object value)
           
 void authenticate(String userID, String psswrd)
           
 void bind(Name name, Object obj)
          Throws a javax.naming.OperationNotSupportedException.
 void bind(String name, Object obj)
          Throws a javax.naming.OperationNotSupportedException.
 void close()
           
 Name composeName(Name name, Name prefix)
           
 String composeName(String name, String prefix)
           
 EJBHomeProxy createEJBHomeProxy(EJBMetaDataImpl ejbData)
           
 Context createSubcontext(Name name)
          Throws a javax.naming.OperationNotSupportedException.
 Context createSubcontext(String name)
          Throws a javax.naming.OperationNotSupportedException.
 void destroySubcontext(Name name)
          Throws a javax.naming.OperationNotSupportedException.
 void destroySubcontext(String name)
          Throws a javax.naming.OperationNotSupportedException.
 Hashtable getEnvironment()
           
 Context getInitialContext(Hashtable environment)
          Creates an Initial Context for beginning name resolution.
 String getNameInNamespace()
           
 NameParser getNameParser(Name name)
           
 NameParser getNameParser(String name)
           
 void init(Hashtable environment)
          Initializes this JNDI context for the client.
 NamingEnumeration list(Name name)
           
 NamingEnumeration list(String name)
           
 NamingEnumeration listBindings(Name name)
           
 NamingEnumeration listBindings(String name)
           
 Object lookup(Name name)
           
 Object lookup(String name)
           
 Object lookupLink(Name name)
           
 Object lookupLink(String name)
           
static void print(String s)
           
static void println(String s)
           
 void rebind(Name name, Object obj)
          Throws a javax.naming.OperationNotSupportedException.
 void rebind(String name, Object obj)
          Throws a javax.naming.OperationNotSupportedException.
 Object removeFromEnvironment(String key)
           
 void rename(Name oldname, Name newname)
          Throws a javax.naming.OperationNotSupportedException.
 void rename(String oldname, String newname)
          Throws a javax.naming.OperationNotSupportedException.
protected  AuthenticationResponse requestAuthorization(AuthenticationRequest req)
           
 void unbind(Name name)
          Throws a javax.naming.OperationNotSupportedException.
 void unbind(String name)
          Throws a javax.naming.OperationNotSupportedException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNDIContext

public JNDIContext()

JNDIContext

public JNDIContext(JNDIContext that)
Method Detail

init

public void init(Hashtable environment)
          throws NamingException
Initializes this JNDI context for the client. Opens a socket connection with the NamingServer. Initializes object output/input streams for writing/reading objects with the naming server. Authenticates the user's information with the NamingServer

Parameters:
environment -
Throws:
NamingException

print

public static void print(String s)

println

public static void println(String s)

requestAuthorization

protected AuthenticationResponse requestAuthorization(AuthenticationRequest req)
                                               throws RemoteException
Throws:
RemoteException

getInitialContext

public Context getInitialContext(Hashtable environment)
                          throws NamingException
Creates an Initial Context for beginning name resolution. Special requirements of this context are supplied using environment.

The environment parameter is owned by the caller. The implementation will not modify the object or keep a reference to it, although it may keep a reference to a clone or copy.

Specified by:
getInitialContext in interface InitialContextFactory
Parameters:
environment - The possibly null environment specifying information to be used in the creation of the initial context.
Returns:
A non-null initial context object that implements the Context interface.
Throws:
NamingException - If cannot create an initial context.

authenticate

public void authenticate(String userID,
                         String psswrd)
                  throws AuthenticationException
Throws:
AuthenticationException

createEJBHomeProxy

public EJBHomeProxy createEJBHomeProxy(EJBMetaDataImpl ejbData)

lookup

public Object lookup(String name)
              throws NamingException
Specified by:
lookup in interface Context
Throws:
NamingException

lookup

public Object lookup(Name name)
              throws NamingException
Specified by:
lookup in interface Context
Throws:
NamingException

list

public NamingEnumeration list(String name)
                       throws NamingException
Specified by:
list in interface Context
Throws:
NamingException

list

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

listBindings

public NamingEnumeration listBindings(String name)
                               throws NamingException
Specified by:
listBindings in interface Context
Throws:
NamingException

listBindings

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

lookupLink

public Object lookupLink(String name)
                  throws NamingException
Specified by:
lookupLink in interface Context
Throws:
NamingException

lookupLink

public Object lookupLink(Name name)
                  throws NamingException
Specified by:
lookupLink in interface Context
Throws:
NamingException

getNameParser

public NameParser getNameParser(String name)
                         throws NamingException
Specified by:
getNameParser in interface Context
Throws:
NamingException

getNameParser

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

composeName

public String composeName(String name,
                          String prefix)
                   throws NamingException
Specified by:
composeName in interface Context
Throws:
NamingException

composeName

public Name composeName(Name name,
                        Name prefix)
                 throws NamingException
Specified by:
composeName in interface Context
Throws:
NamingException

addToEnvironment

public Object addToEnvironment(String key,
                               Object value)
                        throws NamingException
Specified by:
addToEnvironment in interface Context
Throws:
NamingException

removeFromEnvironment

public Object removeFromEnvironment(String key)
                             throws NamingException
Specified by:
removeFromEnvironment in interface Context
Throws:
NamingException

getEnvironment

public Hashtable getEnvironment()
                         throws NamingException
Specified by:
getEnvironment in interface Context
Throws:
NamingException

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Specified by:
getNameInNamespace in interface Context
Throws:
NamingException

close

public void close()
           throws NamingException
Specified by:
close in interface Context
Throws:
NamingException

bind

public void bind(String name,
                 Object obj)
          throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to add beans to the name space.

Specified by:
bind in interface Context
Parameters:
name -
obj -
Throws:
NamingException

bind

public void bind(Name name,
                 Object obj)
          throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to add beans to the name space.

Specified by:
bind in interface Context
Parameters:
name -
obj -
Throws:
NamingException

rebind

public void rebind(String name,
                   Object obj)
            throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to add beans to the name space.

Specified by:
rebind in interface Context
Parameters:
name -
obj -
Throws:
NamingException

rebind

public void rebind(Name name,
                   Object obj)
            throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to add beans to the name space.

Specified by:
rebind in interface Context
Parameters:
name -
obj -
Throws:
NamingException

unbind

public void unbind(String name)
            throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to remove beans from the name space.

Specified by:
unbind in interface Context
Parameters:
name -
Throws:
NamingException

unbind

public void unbind(Name name)
            throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to remove beans from the name space.

Specified by:
unbind in interface Context
Parameters:
name -
Throws:
NamingException

rename

public void rename(String oldname,
                   String newname)
            throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to rename beans.

Specified by:
rename in interface Context
Parameters:
oldname -
newname -
Throws:
NamingException

rename

public void rename(Name oldname,
                   Name newname)
            throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to rename beans.

Specified by:
rename in interface Context
Parameters:
oldname -
newname -
Throws:
NamingException

destroySubcontext

public void destroySubcontext(String name)
                       throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to remove a sub-context from the name space.

Specified by:
destroySubcontext in interface Context
Parameters:
name -
Throws:
NamingException

destroySubcontext

public void destroySubcontext(Name name)
                       throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to remove a sub-context from the name space.

Specified by:
destroySubcontext in interface Context
Parameters:
name -
Throws:
NamingException

createSubcontext

public Context createSubcontext(String name)
                         throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to add a sub-context to the name space.

Specified by:
createSubcontext in interface Context
Parameters:
name -
Returns:
Context
Throws:
NamingException

createSubcontext

public Context createSubcontext(Name name)
                         throws NamingException
Throws a javax.naming.OperationNotSupportedException. Clients are not allowed to add a sub-context to the name space.

Specified by:
createSubcontext in interface Context
Parameters:
name -
Returns:
Context
Throws:
NamingException


Copyright © 1999-2008 OpenEJB. All Rights Reserved.