public class SerialContext extends Object implements Context
Modifier and Type | Field and Description |
---|---|
static String |
EXCEPTION_DURING_LOOKUP |
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 and Description |
---|
SerialContext(Hashtable env,
org.glassfish.hk2.api.ServiceLocator services)
This constructor takes the component id as an argument.
|
SerialContext(String name,
Hashtable environment,
org.glassfish.hk2.api.ServiceLocator h)
Constructor for the context.
|
Modifier and Type | Method and Description |
---|---|
Object |
addToEnvironment(String propName,
Object propVal)
Add to the environment for the current context.
|
void |
bind(Name name,
Object obj)
Bind the object to the specified name.
|
void |
bind(String name,
Object obj)
Bind the object to the specified name.
|
void |
close()
Set the environment for the current context to null when close is called.
|
Name |
composeName(Name name,
Name prefix) |
String |
composeName(String name,
String prefix) |
Context |
createSubcontext(Name name)
Create the specified subcontext.
|
Context |
createSubcontext(String name)
Create the specified subcontext.
|
void |
destroySubcontext(Name name)
Destroy the specified subcontext.
|
void |
destroySubcontext(String name)
Destroy the specified subcontext.
|
Hashtable |
getEnvironment()
Return the environment for the current context.
|
String |
getNameInNamespace()
The getNameInNamespace API is not supported in this context.
|
NameParser |
getNameParser(Name name)
Allow access to the name parser object.
|
NameParser |
getNameParser(String name)
Allow access to the name parser object.
|
NamingEnumeration<NameClassPair> |
list(Name name)
List the contents of the specified context.
|
NamingEnumeration<NameClassPair> |
list(String name)
List the contents of the specified context.
|
NamingEnumeration<Binding> |
listBindings(Name name)
List the bindings in the specified context.
|
NamingEnumeration<Binding> |
listBindings(String name)
List the bindings in the specified context.
|
Object |
lookup(Name name)
Lookup the specifed name in the context.
|
Object |
lookup(String name)
Lookup the specified name in the context.
|
Object |
lookupLink(Name name)
Links are not treated specially.
|
Object |
lookupLink(String name)
Links are not treated specially.
|
void |
rebind(Name name,
Object obj)
Rebind the object to the specified name.
|
void |
rebind(String name,
Object obj)
Rebind the object to the specified name.
|
Object |
removeFromEnvironment(String propName)
Remove from the environment for the current context.
|
void |
rename(Name oldname,
Name newname)
Rename the bound object.
|
void |
rename(String oldname,
String newname)
Rename the bound object.
|
String |
toString() |
void |
unbind(Name name)
Unbind the object with the specified name.
|
void |
unbind(String name)
Unbind the object with the specified name.
|
public static final String EXCEPTION_DURING_LOOKUP
public SerialContext(String name, Hashtable environment, org.glassfish.hk2.api.ServiceLocator h) throws NamingException
NamingException
public SerialContext(Hashtable env, org.glassfish.hk2.api.ServiceLocator services) throws NamingException
NamingException
public String getNameInNamespace() throws NamingException
getNameInNamespace
in interface Context
NamingException
- if there is a naming exception.public Object lookup(String name) throws NamingException
lookup
in interface Context
NamingException
- if there is a naming exception.public Object lookup(Name name) throws NamingException
lookup
in interface Context
NamingException
- if there is a naming exception.public void bind(String name, Object obj) throws NamingException
bind
in interface Context
name
- name that the object is being bound to.obj
- object that is being bound.NamingException
- if there is a naming exception.public void bind(Name name, Object obj) throws NamingException
bind
in interface Context
name
- name that the object is being bound to.obj
- object that is being bound.NamingException
- if there is a naming exception.public void rebind(String name, Object obj) throws NamingException
rebind
in interface Context
name
- name that the object is being bound to.obj
- object that is being bound.NamingException
- if there is a naming exception.public void rebind(Name name, Object obj) throws NamingException
rebind
in interface Context
name
- name that the object is being bound to.obj
- object that is being bound.NamingException
- if there is a naming exception.public void unbind(String name) throws NamingException
unbind
in interface Context
name
- that is being unbound.NamingException
- if there is a naming exception.public void unbind(Name name) throws NamingException
unbind
in interface Context
name
- name that is being unbound.NamingException
- if there is a naming exception.public void rename(String oldname, String newname) throws NamingException
rename
in interface Context
oldname
- old name that the object is bound as.newname
- new name that the object will be bound as.NamingException
- if there is a naming exception.public void rename(Name oldname, Name newname) throws NamingException
rename
in interface Context
oldname
- old name that the object is bound as.newname
- new name that the object will be bound as.NamingException
- if there is a naming exception.public NamingEnumeration<NameClassPair> list(String name) throws NamingException
list
in interface Context
name
- context name.NamingException
- if there is a naming exception.public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
list
in interface Context
name
- context name.NamingException
- if there is a naming exception.public NamingEnumeration<Binding> listBindings(String name) throws NamingException
listBindings
in interface Context
name
- context name.NamingException
- if there is a naming exception.public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
listBindings
in interface Context
name
- context name.NamingException
- if there is a naming exception.public void destroySubcontext(String name) throws NamingException
destroySubcontext
in interface Context
name
- name of the subcontext.NamingException
- if there is a naming exception.public void destroySubcontext(Name name) throws NamingException
destroySubcontext
in interface Context
name
- name of the subcontext.NamingException
- if there is a naming exception.public Context createSubcontext(String name) throws NamingException
createSubcontext
in interface Context
name
- name of the subcontext.NamingException
- if there is a naming exception.public Context createSubcontext(Name name) throws NamingException
createSubcontext
in interface Context
name
- name of the subcontext.NamingException
- if there is a naming exception.public Object lookupLink(String name) throws NamingException
lookupLink
in interface Context
name
- name of the link.NamingException
- if there is a naming exception.public Object lookupLink(Name name) throws NamingException
lookupLink
in interface Context
name
- name of the link.NamingException
- if there is a naming exception.public NameParser getNameParser(String name) throws NamingException
getNameParser
in interface Context
name
- JNDI name, is ignored since there is only one Name Parser
object.NamingException
public NameParser getNameParser(Name name) throws NamingException
getNameParser
in interface Context
name
- JNDI name, is ignored since there is only one Name Parser
object.NamingException
public String composeName(String name, String prefix) throws NamingException
composeName
in interface Context
NamingException
public Name composeName(Name name, Name prefix) throws NamingException
composeName
in interface Context
NamingException
public Object addToEnvironment(String propName, Object propVal) throws NamingException
addToEnvironment
in interface Context
NamingException
- if there is a naming exception.public Object removeFromEnvironment(String propName) throws NamingException
removeFromEnvironment
in interface Context
NamingException
- if there is a naming exception.public Hashtable getEnvironment() throws NamingException
getEnvironment
in interface Context
NamingException
- if there is a naming exception.public void close() throws NamingException
close
in interface Context
NamingException
- if there is a naming exception.Copyright © 2021. All rights reserved.