A MBean that binds an arbitrary InitialContext into the JBoss default
InitialContext as a Reference. If RemoteAccess is enabled, the reference
is a Serializable object that is capable of creating the InitialContext
remotely. If RemoteAccess if false, the reference is to a nonserializable object
that can only be used from within this VM.
| Method from org.jboss.naming.ExternalContext Detail: |
public boolean getCacheContext() {
return contextInfo.getCacheContext();
}
|
public String getInitialContext() {
return contextInfo.getInitialContext();
}
Get the class name of the InitialContext implementation to
use. Should be one of:
- javax.naming.InitialContext
- javax.naming.directory.InitialDirContext
- javax.naming.ldap.InitialLdapContext
|
public String getJndiName() {
return contextInfo.getJndiName();
}
Set the jndi name under which the external context is bound. |
public Properties getProperties() throws IOException {
return contextInfo.getProperties();
}
Get the InitialContex class environment properties. |
public boolean getRemoteAccess() {
return remoteAccess;
}
|
public void setCacheContext(boolean cacheContext) {
contextInfo.setCacheContext(cacheContext);
}
|
public void setInitialContext(String className) throws ClassNotFoundException {
contextInfo.loadClass(className);
}
Set the class name of the InitialContext implementation to
use. Should be one of:
- javax.naming.InitialContext
- javax.naming.directory.InitialDirContext
- javax.naming.ldap.InitialLdapContext
|
public void setJndiName(String jndiName) throws NamingException {
contextInfo.setJndiName(jndiName);
if( super.getState() == STARTED )
{
unbind(jndiName);
try
{
rebind();
}
catch(Exception e)
{
NamingException ne = new NamingException("Failed to update jndiName");
ne.setRootCause(e);
throw ne;
}
}
}
Set the jndi name under which the external context is bound. |
public void setProperties(Properties props) throws IOException {
contextInfo.setProperties(props);
}
Set the InitialContex class environment properties. |
public void setPropertiesURL(String contextPropsURL) throws IOException {
contextInfo.loadProperties(contextPropsURL);
}
Set the InitialContex class environment properties from the given URL. |
public void setRemoteAccess(boolean remoteAccess) {
this.remoteAccess = remoteAccess;
}
|
protected void startService() throws Exception {
rebind();
}
Start the service by binding the external context into the
JBoss InitialContext. |
protected void stopService() throws Exception {
if( contextInfo.getCacheContext() )
unbind(contextInfo.getJndiName());
}
Stop the service by unbinding the external context into the
JBoss InitialContext. |